<?php

/**
 * index
 * @author xiaofeng 
 * @version 1.0
 * @package application
 */
class Index extends Front_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('news_model');
        $this->load->model('news_class_model');
        $this->load->model('goods_model');
    }

    //首页
    public function index() {

        $data = array();
//        $infos = array(
//            //优秀案例                                     id          
//            'goods_info' => array('name' => '优秀案例', 'more' => '1', 'english' => 'GOOD CASES'),
//            //行业新闻
//            'news' => array('name' => '行业新闻', 'more' => '39', 'english' => '/Industry News', 'lists' => '39/1'),
//            //技术支持
//            'technology' => array('name' => '技术支持', 'more' => '9', 'english' => '/ Technology', 'lists' => '9/2'),
//            //关于凌宇
//            'abouts' => array('name' => '关于凌宇', 'more' => '16'),
//            //公司新闻
//            'company_news' => array('name' => '公司新闻', 'more' => '38', 'lists' => '38/3'),
//            //联系我们
//            'Contact_us' => array('name' => '联系我们', 'more' => '21', 'english' => '/ Contact us', 'lists' => '21/217'),
//        );
//        $data['infos'] = $infos;
//        //$data['nav_data'] = $this->news_class_model->all();
//        $data['company_news'] = $this->news_model->get_by_parentid('38', '6'); //公司新闻
//        //$data1['attributes']['goods_commend'] =1;
//        $data1['limit']['persize'] = 3; //显示3条
//        $data1['orders'] = array('created' => 'desc'); //按创建时间排序
//        $data['goods_data'] = $this->goods_model->all($data1); //优秀案例
//
//        $data['technology'] = $this->news_model->get_by_parentid('9', '8'); //技术支持
//        $data['abouts'] = $this->news_model->get_by_parentid('16', '1'); //关于凌宇
//        $data['Contact_us'] = $this->news_model->get_by_parentid('21', '1'); //联系我们
//
//        $search_data = array(
//            'in' => array(
//                'parentid' => array(39),
//            ),
//            'orders' => array(
//                'created' => 'desc',
//            ),
//            'limit' => array(
//                'persize' => 6,
//            //'offset'=>$offset,
//            ),
//        );
//        $data['news_data'] = $this->news_model->all($search_data); //行业新闻
//        //$data['topid'] = $topid;
//        $this->load->model('link_model');
//        $data['link_data'] = $this->link_model->all(); //友情链接
//        //$data['get_slides']=$this->get_slides();//首页轮播
        //$this->headerInfo(); //获取导航栏菜单
        $this->load->view($this->_site_path . "/index/index", $data);
    }

//	//获取首页轮播
//	public function get_slides(){
//	
//		$search = array(
//			'orders' => array('sort'=>asc),
//			'limit'     =>array('persize' => 4, 'offset' => 0),
//		);
//		$fileds = array('img_url, url, img_title, img_descript');
//		$data['slides'] = $this->slide_model->get_appoint_values($fileds, null, $search);
//		return $this->load->view_part( $this->_site_path."/index/get_slides", $data ,true);//将视图作为html数据返回
//	}
}
